/**
 * @description aigc管理模块api
 */

import { http } from '../http'

const { get, put, post, formPost, delete: del, download } = http

// 系统管理---教师管理
export const teacherManageApi = {
  list: get('/spa/authorization/v1/teachers/page'),
  del: del(`/spa/authorization/v1/teacher/:id`),
  delList: del(`/spa/authorization/v1/teacher`),
  add: post('/spa/authorization/v1/teacher'),
  update: put('/spa/authorization/v1/teacher'),
  getDetailById: get('/spa/authorization/v1/teacher/:id'),
  resetPws: put('/spa/authorization/v1/reset-teacher/:id'),
  batchSetOrg: put('/spa/authorization/v1/teacher/org'),
  getOrganizationTree: get('/spa/authorization/v1/org/tree'),
  getRoles: get('/spa/authorization/v1/roles')
}

// 系统管理---学生和班级管理
export const studentsManageApi = {
  list: get('/spa/authorization/v1/students/page'),
  del: del(`/spa/authorization/v1/student/:id`),
  delList: del(`/spa/authorization/v1/student`),
  add: post('/spa/authorization/v1/student'),
  update: put('/spa/authorization/v1/student'),
  getDetailById: get('/spa/authorization/v1/student/:id'),
  resetPws: put('/spa/authorization/v1/reset-student/:id'),
  getOrganizationTree: get('/spa/authorization/v1/org/tree'),
  getLink: get('/spa/authorization/v1/invite-notice/url/:id'),
  createInviteLink: post('/spa/authorization/v1/invite-notice'),
  delInviteLink: del('/spa/authorization/v1/invite-notice/:id'),
  updateInviteInfo: put('/spa/authorization/v1/invite-notice'),
  checkLink: get('/spa/authorization/v1/invite-notice/:code'),
  join: post('/spa/authorization/v1/invite-record'),
  joinList: get('/spa/authorization/v1/invite-record'),
  allowOrReject: put('/spa/authorization/v1/invite-record/batch'),
  allowOrRejectSingle: put('/spa/authorization/v1/invite-record/single'),
  filePost: post('/spa/authorization/v1/student/import'),
  fileUpload: post('/spa/authorization/v1/student/import')
}

// 系统管理---学校组织管理
export const schoolOrganizationManageApi = {
  list: get('/spa/authorization/v1/org/tree-count'),
  getOrganizationTree: get('/spa/authorization/v1/org/tree'),
  listWithoutClass: get('/spa/authorization/v1/org-exclude-class/tree'),
  add: post('/spa/authorization/v1/org'),

  edit: put('/spa/authorization/v1/org'),
  detail: (id: string) => get(`/spa/authorization/v1/org/${id}`),
  del: (id: string) => del(`/spa/authorization/v1/org/${id}`)
}

// 系统管理---学习案例
export const learningCaseManageApi = {
  list: get('/spa/aigc/v1/learn-case'),
  del: del('/spa/aigc/v1/learn-case/case'),
  caseStatisticsList: get('/spa/aigc/v1/learn-case/statistics'),
  getDetail: (id: string) => get(`/spa/aigc/v1/learn-case/${id}`),
  add: post('/spa/aigc/v1/learn-case'),
  edit: put('/spa/aigc/v1/learn-case'),
  orgAuthTree: get('/spa/authorization/v1/org-auth'),
  orgAuthTreeSearch: get('/spa/authorization/v1/org-auth/search')
}

// 系统管理---学习任务
export const learningTasksManageApi = {
  list: get('/spa/aigc/v1/learn-task'),
  del: del('/spa/aigc/v1/learn-task'),
  caseStatisticsList: get('/spa/aigc/v1/learn-case/statistics'),
  getDetail: (id: string) => get(`/spa/aigc/v1/learn-task/${id}`),
  add: post('/spa/aigc/v1/learn-task'),
  publish: post('/spa/aigc/v1/learn-task/publish'),
  edit: put('/spa/aigc/v1/learn-task'),
  orgAuthTree: get('/spa/authorization/v1/org-auth'),
  orgAuthTreeSearch: get('/spa/authorization/v1/org-auth/search'),
  // 评价详情
  evaluationDetail: get('/spa/aigc/v1/learn-task/evaluation'),
  // 学生评价列表
  evaluationStudentsList: get('/spa/authorization/v1/students/evaluate'),
  // 学生评价下载附件
  evaluationDownload: post(`/spa/aigc/v1/learn-task/download`), //下载
  // 学生单独评价信息
  singleStudentEvaluation: get('/spa/aigc/v1/learn-task/evaluation'),
  // 保存评价
  saveEvaluation: post('/spa/aigc/v1/learn-task/evaluation'),
  // 查询参数
  queryParameter: get(`/spa/aigc/v1/record/:id`)
}

// 系统管理---学生绘图管理
export const studentDrawingManageApi = {
  list: get('/spa/aigc/v1/record-details/page-summary'),
  getDetail: get(`/spa/aigc/v1/record/:id`)
}
